In a two-dimensional electron gas with Rashba and Dresselhaus spin-orbit couplings, there are two spin-split energy surfaces connected with a degenerate point. Both the energy surfaces and the topology of the Fermi surfaces can be varied by an in-plane magnetic field. We find that, if the chemical potential falls between the bottom of the upper band and the degenerate point, then simply by changing the direction of the magnetic field, the magnitude of the spin Hall conductivity can be varied by about 100 percent. Once the chemical potential is above the degenerate point, the spin Hall conductivity becomes the constant $e/8\pi$, independent of the magnitude and direction of the magnetic field. In addition, we find that the in-plane magnetic field exerts no influence on the charge Hall conductivity.